import { RouteRecordRaw } from "vue-router";
import { Route } from "./index";
const Home = () => import('@/view/Home/home.vue')
const NotFound = () => import("@/view/errorPage/404.vue")
const Forbidden = () => import("@/view/errorPage/403.vue")
const Layout = () => import("@/view/layout/index.vue")

// 准备动态加载的路由
const DynamicRoutes: Array<Route> = [
  {
    path: "",
    name: "container",
    component: Layout,
    redirect: 'home',
    meta: {
      requiresAuth: true, // 是否需要登录
      name: "首页"
    },
    children: [
      {
        path: "/home",
        name: "home",
        component: Home,
        meta: {
          name: "首页",
          icon: "icon-name"
        }
      },
    ],
  },
  {
    path: "/403",
    component: Forbidden
  },
  {
    path: "/:catchAll(.*)",
    component: NotFound
  }
]
export default DynamicRoutes